package com.yan.design.two.behavior.s6;

/**
 * 6. 中介者模式
 *      测试类
 * @author shengren.yan
 * @create 2022-08-101
 */
public class testRun {

    public static void main(String[] args) {
        User u1 = new User("李","123");
        User u2 = new User("王","456");
        // 中介
        Mediator m = new Mediator();
        m.register("北京",u1);
        m.register("四川",u2);

        User u3 = new User("查询人","000");
        User u = u3.find("北京", m);
        if (u!=null){
            System.out.println(u);
        }
    }
}
